<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:forgeview="http://jboss.org/forge/view"	
	template="/resources/scaffold/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{ido4SaleOrderBean.id}"/>
		<f:event type="preRenderView" listener="#{ido4SaleOrderBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Ido 4Sale Order"/>

	<ui:define name="header">
		Ido 4Sale Order
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty ido4SaleOrderBean.id}">
				Edit existing Ido 4Sale Order
			</c:when>
			<c:otherwise>
				Create a new Ido 4Sale Order
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoNo" value="So No:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoNo" required="true" value="#{ido4SaleOrderBean.ido4SaleOrder.soNo}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoDescr" value="So Descr:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoDescr" maxLength="100" required="true" value="#{ido4SaleOrderBean.ido4SaleOrder.soDescr}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoDescr" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoDate" value="So Date:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoDate" maxLength="10" required="true" value="#{ido4SaleOrderBean.ido4SaleOrder.soDate}">
						<f:convertDateTime type="date"/>
					</h:inputText>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoDate" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoCustNo" value="So Cust No:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoCustNo" value="#{ido4SaleOrderBean.ido4SaleOrder.soCustNo}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoCustNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoCustCode" value="So Cust Code:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoCustCode" maxLength="50" value="#{ido4SaleOrderBean.ido4SaleOrder.soCustCode}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoCustCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoCustTitleCode" value="So Cust Title Code:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoCustTitleCode" maxLength="10" value="#{ido4SaleOrderBean.ido4SaleOrder.soCustTitleCode}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoCustTitleCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoCustFirstName" value="So Cust First Name:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoCustFirstName" maxLength="50" value="#{ido4SaleOrderBean.ido4SaleOrder.soCustFirstName}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoCustFirstName" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoCustLastName" value="So Cust Last Name:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoCustLastName" maxLength="50" value="#{ido4SaleOrderBean.ido4SaleOrder.soCustLastName}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoCustLastName" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoCustIdCardNo" value="So Cust Id Card No:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoCustIdCardNo" maxLength="20" value="#{ido4SaleOrderBean.ido4SaleOrder.soCustIdCardNo}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoCustIdCardNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoDiscountPerc" value="So Discount Perc:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoDiscountPerc" required="true" value="#{ido4SaleOrderBean.ido4SaleOrder.soDiscountPerc}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoDiscountPerc" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoDiscountVal" value="So Discount Val:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoDiscountVal" required="true" value="#{ido4SaleOrderBean.ido4SaleOrder.soDiscountVal}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoDiscountVal" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoDiscountTotal" value="So Discount Total:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoDiscountTotal" required="true" value="#{ido4SaleOrderBean.ido4SaleOrder.soDiscountTotal}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoDiscountTotal" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoStatusIncVat" value="So Status Inc Vat:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoStatusIncVat" required="true" value="#{ido4SaleOrderBean.ido4SaleOrder.soStatusIncVat}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoStatusIncVat" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoVatPercVal" value="So Vat Perc Val:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoVatPercVal" required="true" value="#{ido4SaleOrderBean.ido4SaleOrder.soVatPercVal}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoVatPercVal" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoTotalPriceExcVat" value="So Total Price Exc Vat:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoTotalPriceExcVat" required="true" value="#{ido4SaleOrderBean.ido4SaleOrder.soTotalPriceExcVat}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoTotalPriceExcVat" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoTotalVat" value="So Total Vat:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoTotalVat" required="true" value="#{ido4SaleOrderBean.ido4SaleOrder.soTotalVat}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoTotalVat" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoTotalPrice" value="So Total Price:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoTotalPrice" required="true" value="#{ido4SaleOrderBean.ido4SaleOrder.soTotalPrice}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoTotalPrice" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoStatusNo" value="So Status No:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoStatusNo" value="#{ido4SaleOrderBean.ido4SaleOrder.soStatusNo}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoStatusNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoAddr" value="So Addr:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoAddr" maxLength="500" value="#{ido4SaleOrderBean.ido4SaleOrder.soAddr}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoAddr" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderSoMemo01" value="So Memo 01:"/>
				<h:panelGroup>
					<h:inputText id="ido4SaleOrderBeanIdo4SaleOrderSoMemo01" maxLength="1000" value="#{ido4SaleOrderBean.ido4SaleOrder.soMemo01}"/>
					<h:message for="ido4SaleOrderBeanIdo4SaleOrderSoMemo01" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderIdo4SaleOrderCustAddrs" value="Ido 4Sale Order Cust Addrs:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{ido4SaleOrderBean.ido4SaleOrder.ido4SaleOrderCustAddrs}"/>
					<h:dataTable id="ido4SaleOrderBeanIdo4SaleOrderIdo4SaleOrderCustAddrs" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Cust Addr Type No"/>
							</f:facet>
							<h:link outcome="/ido4SaleOrderCustAddr/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSoCustAddrTypeNo" value="#{_item.soCustAddrTypeNo}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="ido4SaleOrderCustAddrBeanAddSoCustAddrTypeNo" value="#{ido4SaleOrderCustAddrBean.add.soCustAddrTypeNo}"/>
								<h:message for="ido4SaleOrderCustAddrBeanAddSoCustAddrTypeNo" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Cust Addr No"/>
							</f:facet>
							<h:link outcome="/ido4SaleOrderCustAddr/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSoCustAddrNo" value="#{_item.soCustAddrNo}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="ido4SaleOrderCustAddrBeanAddSoCustAddrNo" maxLength="20" value="#{ido4SaleOrderCustAddrBean.add.soCustAddrNo}"/>
								<h:message for="ido4SaleOrderCustAddrBeanAddSoCustAddrNo" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Cust Addr Moo"/>
							</f:facet>
							<h:link outcome="/ido4SaleOrderCustAddr/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSoCustAddrMoo" value="#{_item.soCustAddrMoo}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="ido4SaleOrderCustAddrBeanAddSoCustAddrMoo" maxLength="10" value="#{ido4SaleOrderCustAddrBean.add.soCustAddrMoo}"/>
								<h:message for="ido4SaleOrderCustAddrBeanAddSoCustAddrMoo" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Cust Addr Soi"/>
							</f:facet>
							<h:link outcome="/ido4SaleOrderCustAddr/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSoCustAddrSoi" value="#{_item.soCustAddrSoi}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="ido4SaleOrderCustAddrBeanAddSoCustAddrSoi" maxLength="100" value="#{ido4SaleOrderCustAddrBean.add.soCustAddrSoi}"/>
								<h:message for="ido4SaleOrderCustAddrBeanAddSoCustAddrSoi" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Cust Addr Road"/>
							</f:facet>
							<h:link outcome="/ido4SaleOrderCustAddr/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSoCustAddrRoad" value="#{_item.soCustAddrRoad}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="ido4SaleOrderCustAddrBeanAddSoCustAddrRoad" maxLength="100" value="#{ido4SaleOrderCustAddrBean.add.soCustAddrRoad}"/>
								<h:message for="ido4SaleOrderCustAddrBeanAddSoCustAddrRoad" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(ido4SaleOrderCustAddrBean.added)}" id="ido4SaleOrderBeanIdo4SaleOrderIdo4SaleOrderCustAddrsAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{ido4SaleOrderCustAddrBean.add.ido4SaleOrder}" value="#{ido4SaleOrderBean.ido4SaleOrder}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="ido4SaleOrderBeanIdo4SaleOrderIdo4SaleOrderItems" value="Ido 4Sale Order Items:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{ido4SaleOrderBean.ido4SaleOrder.ido4SaleOrderItems}"/>
					<h:dataTable id="ido4SaleOrderBeanIdo4SaleOrderIdo4SaleOrderItems" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Qty"/>
							</f:facet>
							<h:link outcome="/ido4SaleOrderItem/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSoQty" value="#{_item.soQty}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="ido4SaleOrderItemBeanAddSoQty" value="#{ido4SaleOrderItemBean.add.soQty}"/>
								<h:message for="ido4SaleOrderItemBeanAddSoQty" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Ppu"/>
							</f:facet>
							<h:link outcome="/ido4SaleOrderItem/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSoPpu" value="#{_item.soPpu}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="ido4SaleOrderItemBeanAddSoPpu" value="#{ido4SaleOrderItemBean.add.soPpu}"/>
								<h:message for="ido4SaleOrderItemBeanAddSoPpu" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Status Inc Vat"/>
							</f:facet>
							<h:link outcome="/ido4SaleOrderItem/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSoStatusIncVat" value="#{_item.soStatusIncVat}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="ido4SaleOrderItemBeanAddSoStatusIncVat" value="#{ido4SaleOrderItemBean.add.soStatusIncVat}"/>
								<h:message for="ido4SaleOrderItemBeanAddSoStatusIncVat" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Vat Perc Val"/>
							</f:facet>
							<h:link outcome="/ido4SaleOrderItem/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSoVatPercVal" value="#{_item.soVatPercVal}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="ido4SaleOrderItemBeanAddSoVatPercVal" value="#{ido4SaleOrderItemBean.add.soVatPercVal}"/>
								<h:message for="ido4SaleOrderItemBeanAddSoVatPercVal" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="So Vat"/>
							</f:facet>
							<h:link outcome="/ido4SaleOrderItem/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSoVat" value="#{_item.soVat}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="ido4SaleOrderItemBeanAddSoVat" value="#{ido4SaleOrderItemBean.add.soVat}"/>
								<h:message for="ido4SaleOrderItemBeanAddSoVat" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(ido4SaleOrderItemBean.added)}" id="ido4SaleOrderBeanIdo4SaleOrderIdo4SaleOrderItemsAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{ido4SaleOrderItemBean.add.ido4SaleOrder}" value="#{ido4SaleOrderBean.ido4SaleOrder}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{ido4SaleOrderBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty ido4SaleOrderBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{ido4SaleOrderBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{ido4SaleOrderBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>